﻿@model XSTDZ.ERP.Application.DataContracts.ReceivablePayableBillDto
@{
    ViewBag.Title = " - 期初账务";
}
@section header{
     <link href="@Url.Content("~/Content/Controls.css")" rel="stylesheet" type="text/css" />
 <link href="@Url.Content("~/Content/Form.css")" rel="stylesheet" type="text/css" />
}
<h2>期初账务</h2>
<div class="wp100">
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <table class="formtable">
    <thead>
        <tr>
            <th colspan="4">
            <div id="toptoolbar"></div>
            </th>
        </tr>
    </thead>
    
     <tr>
       
        <td class="title"> @Html.LabelFor(model => model.ClientID)<b>*</b></td>
        <td> 
        @Html.TextBoxFor(model => model.ClientName, new { @class = "text" })
        @Html.HiddenFor(model => model.ClientID) 
        @Html.ValidationMessageFor(model => model.ClientID) 
          @Html.HiddenFor(model => model.ID)
           @Html.HiddenFor(model => model.OrgID)
          <a href="javascript:void(0);" onclick="javascript:selectClient('ClientName','ClientID');" >选择</a>
        </td>

        <td class="title">@Html.LabelFor(model => model.BillClassify)<b>*</b></td>
        <td><select name="BillClassify" id="BillClassify"><option value="0" selected="selected">收款</option><option value="1">付款</option></select>
         
         </td>
  </tr>
         <tr id="divRec1">
       
        <td class="title"> @Html.LabelFor(model => model.BillReceivable)<b>*</b></td>
        <td> @Html.TextBoxFor(model => model.BillReceivable,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.BillReceivable)
        </td>

        <td class="title"> @Html.LabelFor(model => model.BillReceiv)</td>
        <td> @Html.TextBoxFor(model => model.BillReceiv,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.BillReceiv)
        </td>

  </tr> 
    <tr id="divRec2">
        <td class="title"> @Html.LabelFor(model => model.BillReceivPft)</td>
        <td> @Html.TextBoxFor(model => model.BillReceivPft,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.BillReceivPft)
        </td>

        <td class="title"></td>
        <td>
        </td>

  </tr> 
        <tr id="divPay1" style=" display:none;">
       
        <td class="title"> @Html.LabelFor(model => model.BillPayable)<b>*</b></td>
        <td> @Html.TextBoxFor(model => model.BillPayable,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.BillPayable)
        </td>

        <td class="title"> @Html.LabelFor(model => model.BillPay)</td>
        <td> @Html.TextBoxFor(model => model.BillPay, new { @class = "text" })
        @Html.ValidationMessageFor(model => model.BillPay)
        </td>

  </tr> 
    <tr id="divPay2" style=" display:none;">
        <td class="title"> @Html.LabelFor(model => model.BillPayPft)</td>
        <td> @Html.TextBoxFor(model => model.BillPayPft,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.BillPayPft)
        </td>

        <td class="title"></td>
        <td>
        </td>

  </tr> 
    <tr>

        <td class="title"> @Html.LabelFor(model => model.Remarks)</td>
        <td colspan="3"> @Html.TextBoxFor(model => model.Remarks,  new { @class = "text"})
        @Html.ValidationMessageFor(model => model.Remarks)
        </td>
  </tr> 
  <tr>
        <td  colspan="4">
              <p class="divBtn">
            
               <input type="hidden" id="hidHttpRefeParent" name="hidHttpRefeParent" value="grid" />
            <input type="hidden" id="hidHttpPostState" name="hidHttpPostState" value="@ViewBag.PostState" />
            <input type="submit" value="@XSTDZ.ERP.Infrastructure.SystemConfig.BtnSave"  class="BtnSubmit" id="submitBtn" name="submitBtn" />
        </p>
        </td>
    </tr>
    </table>
        <input id="HidOrgCode" name="HidOrgCode" type="hidden" value="@ViewBag.orgCode" />
        <input id="HidEmptyGuid" name="HidEmptyGuid" type="hidden" value="@Guid.Empty" />
}
</div>
<script type="text/javascript">
    $(document).ready(function () {
        //添加客户列表
       
        $("#BillClassify").unbind("change").bind("change", selectCity);
    });
    function selectClient(clientName, clientId) {
        var returnValue = window.showModalDialog("../Client/SelectClient?orgCode=@ViewBag.orgCode", window, "help:No;resizable:No;status:No;scroll:yes;location:No;dialogWidth=800px;dialogHeight=500px");
        if (returnValue != null && returnValue != undefined) {
            $("#" + clientName).val(returnValue[0]);
            $("#" + clientId).val(returnValue[1]);
        }
    }
    //选择省级，市级联动变化 --开始
    function selectCity() {
        var pval = $("#BillClassify").val();
        if (pval != undefined) {
            if (pval == 1) {
                $("#divRec1").css("display", "none");
                $("#divRec2").css("display", "none");

                $("#divPay1").css("display", "");
                $("#divPay2").css("display", "");
            }
            else {
                $("#divRec1").css("display", "");
                $("#divRec2").css("display", "");

                $("#divPay1").css("display", "none");
                $("#divPay2").css("display", "none");
            }
        }
    }
</script>

<script type="text/javascript" src="@Url.Content("~/Content/js/formBase.js")"></script>